package cn.weiyang.controller;

import cn.weiyang.model.Result;
import cn.weiyang.model.User;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * Created by Administrator on 2017/7/27.
 */
@RestController
public class UserController {
    /**
     * 添加用户
     * @param user
     * @return
     */
    @RequestMapping("/user/add")
    public Result addUser(@Validated(User.GroupA.class) User user){
        return new Result();
    }

    /**
     * 编辑用户
     * @param user
     * @return
     */
    @RequestMapping("/user/edit")
    public Result editUser(@Validated(User.GroupB.class) User user){
        return new Result();
    }
}
